#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

#include "goldgame.h"


void initgolddata(char * data,int gametype){
	/*游戏数据
	 x,y,t;x,y,t;   (x,y)为坐标,t为黄金和石头的类型
	 */
	int x,y;
	int i;
	int t;
	char tmp[255]={0};
	//5块大黄金
	t=1;
	for(i=0;i<5;i++){
		x=rand()%1000;
		y=rand()%500;
		sprintf(tmp,"%d,%d,%d;",x,y,t);
		strcat(data,tmp);
	}

	//10块中黄金
	t=2;
	for(i=0;i<10;i++){
		x=rand()%1000;
		y=rand()%500;
		sprintf(tmp,"%d,%d,%d;",x,y,t);
		strcat(data,tmp);
	}

	//20块小黄金
	t=3;
	for(i=0;i<20;i++){
		x=rand()%1000;
		y=rand()%500;
		sprintf(tmp,"%d,%d,%d;",x,y,t);
		strcat(data,tmp);
	}

	data[strlen(data)-1]='\0';


}
